Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script> function preferedBrowser() { prefer = document.forms[0].browsers.value; alert("You prefer browsing internet with " + prefer); } </script> </head> <body> <form> Choose which browser you prefer: <select id="browsers" onchange="preferedBrowser()"> <option value="Chrome">Chrome</option> <option value="Internet Explorer">Internet Explorer</option> <option value="Firefox">Firefox</option> </select> </form> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_events_dropdown by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:37:13 GMT --> </html>
Result:
Try it Yourself - © w3schools.com